package xty.user.dao.impl;

import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
import xty.user.dao.IMongoStudentDao;
import xty.user.entity.Student;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by XieTianYi on 2020/1/29.
 *
 * @author XieTianYi
 */
@Repository
public class MongoStudentDaoImpl implements IMongoStudentDao {
    @Resource
    private MongoTemplate mongoTemplate;

    @Override
    public List<Student> find(Query query) {
        return mongoTemplate.find(query, Student.class);
    }
}
